package com.itfreer.power.service.jurisdiction;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.itfreer.form.api.BaseDao;
import com.itfreer.form.api.imp.DictionaryServiceImp;
import com.itfreer.form.dictionary.base.DictionaryItem;
import com.itfreer.power.dao.jurisdiction.RegisterServiceDao;
import com.itfreer.power.entity.jurisdiction.RegisterServiceEntity;

/**
 * 业务系统管理类
 */
@Component("registerServiceService")
public class RegisterServiceServiceBase extends DictionaryServiceImp<RegisterServiceEntity> implements RegisterServiceService {

	@Autowired
	private RegisterServiceDao registerServiceDao;
	
	@Override
	protected BaseDao<RegisterServiceEntity> getDao() {
		return registerServiceDao;
	}

	@Override
	public String getDictionaryName() {
		return "p_register_service";
	}

	@Override
	protected DictionaryItem convert(RegisterServiceEntity entity) {
		DictionaryItem toEntity = new DictionaryItem();
		BeanUtils.copyProperties(entity, toEntity);
		toEntity.getOther().put("ifprovide", entity.getIfprovide());
		toEntity.getOther().put("ifpower", entity.getIfpower());
		return toEntity;
	}

	@Override
	protected String getDictionaryFields() {
		return "id,code,display,valid,order,ifprovide,ifpower";
	}
}